package com.jiepu.daily.corejava.advanceed.part7io.day0808;

import java.io.*;

/**
 * @Description:
 * @author: xinjie
 * @date: 2020/8/8  15:51
 */
public class IoDemo10 {
	public static void main(String[] args) throws IOException {
		byte[] buf = new byte[4096];
		String sourcePath = "src/com/jiepu/daily/advanceed/part7_io/io_test/demo10.txt";
		String targetPath = "src/com/jiepu/daily/advanceed/part7_io/io_test/demo10-copy.txt";

		FileInputStream fis = null;
		FileOutputStream fos = null;

		BufferedInputStream bis = null;
		BufferedOutputStream bos = null;

		try {
			fis = new FileInputStream(sourcePath);
			bis = new BufferedInputStream(fis);

			fos = new FileOutputStream(targetPath);
			bos = new BufferedOutputStream(fos);
		} catch (IOException e) {
			e.printStackTrace();
		}

		int len = -1;
		while ((len = fis.read(buf)) != -1){

		}

		if (bos != null){
			bos.close();
		}

	} // main
}
